package c2.advanced.share;

import c2.advanced.business.AdvancedBody;
import c2.advanced.share.play.AdvancedPlayBuildContext;
import cate.game.fight.hallow.BattleHallowBuilder;
import cate.game.fight.hero.BattleHeroBuilder;
import cate.game.fight.pet.BattlePetBuilder;
import cate.game.play.part.SideBuilder;

/** 战斗剧本处理 */
public class PlayFacade {

    private final AdvancedBody context;

    public PlayFacade(AdvancedBody context) {
        this.context = context;
    }

    public SideBuilder sideBuilder;

    private AdvancedPlayBuildContext pbc;
    public AdvancedPlayBuildContext getPlayBuildContext() {
        return this.pbc;
    }


    public void setup() throws Exception {
        pbc = new AdvancedPlayBuildContext(context);

        BattleHeroBuilder heroBuilder = new BattleHeroBuilder();
        heroBuilder.init(pbc);
        pbc.setHeroBuilder(heroBuilder);

        BattleHallowBuilder hallowBuilder = new BattleHallowBuilder();
        hallowBuilder.init(pbc);
        pbc.setHallowBuilder(hallowBuilder);

        BattlePetBuilder petBuilder = new BattlePetBuilder();
        petBuilder.init(pbc);
        pbc.setPetBuilder(petBuilder);

        this.sideBuilder = new SideBuilder();
        this.sideBuilder.init(pbc);
    }
}
